home *** CD-ROM | disk | FTP | other *** search
/ IRIX Development Foundation 1.1 for IRIX 6.2 / SGI IRIX 6.2 Development Foundation 1.1.iso / dist / patchSG0001645.idb / usr / include / limits.h.z / limits.h
C/C++ Source or Header  |  1997-07-01  |  10KB  |  315 lines

  1. /*
  2.  *
  3.  * Copyright 1992,1993, 1994,1995 Silicon Graphics, Inc.
  4.  * All Rights Reserved.
  5.  *
  6.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  7.  * the contents of this file may not be disclosed to third parties, copied or
  8.  * duplicated in any form, in whole or in part, without the prior written
  9.  * permission of Silicon Graphics, Inc.
  10.  *
  11.  * RESTRICTED RIGHTS LEGEND:
  12.  * Use, duplication or disclosure by the Government is subject to restrictions
  13.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  14.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  15.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  16.  * rights reserved under the Copyright Laws of the United States.
  17.  */
  18. /*    Copyright (c) 1988 AT&T    */
  19. /*      All Rights Reserved      */
  20.  
  21. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T    */
  22. /*    The copyright notice above does not evidence any       */
  23. /*    actual or intended publication of such source code.    */
  24. #ifndef __LIMITS_H__
  25. #define __LIMITS_H__
  26.  
  27. #ident "$Revision: 7.36 $"
  28. #include <standards.h>
  29. #include <sgidefs.h>
  30.  
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. /*
  35.  * Note - this header is an ANSI/POSIX/POSIX2/POSIX1b/POSIX1c header. Carefull!
  36.  */
  37.  
  38. /*
  39.  * ANSI limits
  40.  */
  41. #define CHAR_BIT        8           /* max # of bits in a "char" */
  42. #define CHAR_MAX        UCHAR_MAX    /* max value of a "char" */
  43. #define CHAR_MIN        0        /* min value of a "char" */
  44. #define INT_MAX         2147483647      /* max value of an "int" */
  45. #define INT_MIN         (-2147483647-1) /* min value of an "int" */
  46. #define SCHAR_MIN    (-128)        /* min value of a "signed char" */
  47. #define SCHAR_MAX    127        /* max value of a "signed char" */
  48. #define UCHAR_MAX    255U        /* max value of an "unsigned char" */
  49.  
  50. #define MB_LEN_MAX    5
  51.  
  52.  
  53. #define SHRT_MIN        (-32768)        /* min value of a "short int" */
  54. #define SHRT_MAX        32767           /* max value of a "short int" */
  55. #define USHRT_MAX       65535U        /* max value of an "unsigned short int" */
  56. #define UINT_MAX        4294967295U    /* max value of an "unsigned int" */
  57. #if (_MIPS_SZLONG == 32)
  58. #define LONG_MIN        (-2147483647-1)        /* min value of a "long int" */
  59. #define LONG_MAX        2147483647      /* max value of a "long int" */
  60. #define ULONG_MAX       4294967295U     /* max value of an "unsigned long int" */
  61. #endif
  62. #if (_MIPS_SZLONG == 64)
  63. #define LONG_MIN        (-9223372036854775807L-1L) /* min value of a "long int" */
  64. #define LONG_MAX        9223372036854775807L /* max value of a "long int" */
  65. #define ULONG_MAX       18446744073709551615LU /* max value of an "unsigned long int" */
  66. #endif
  67.  
  68. #if _SGIAPI
  69. #define LONGLONG_MIN        (-9223372036854775807LL-1LL) /* min "long long int" */
  70. #define LONGLONG_MAX        9223372036854775807LL /* max "long long int" */
  71. #define ULONGLONG_MAX       18446744073709551615LLU /* max "unsigned long long int" */
  72. #endif
  73.  
  74.  
  75. #if _POSIX90 && _NO_ANSIMODE
  76. /* POSIX90 conformant definitions - An implementation may define
  77.  * other symbols which reflect the actual implementation. Alternate
  78.  * definitions may not be as restrictive as the POSIX definitions.
  79.  */
  80.  
  81. #define _POSIX_ARG_MAX        4096
  82. #define _POSIX_CHILD_MAX       6
  83. #define _POSIX_LINK_MAX           8
  84. #define _POSIX_MAX_CANON     255
  85. #define _POSIX_MAX_INPUT     255
  86. #define _POSIX_NAME_MAX          14
  87. #define _POSIX_NGROUPS_MAX       0
  88. #define _POSIX_OPEN_MAX          16
  89. #define _POSIX_PATH_MAX         255
  90. #define _POSIX_PIPE_BUF         512
  91. #define _POSIX_SSIZE_MAX       32767
  92. #define _POSIX_STREAM_MAX          8
  93. #define _POSIX_TZNAME_MAX          3
  94. #endif /* _POSIX90 */
  95.  
  96. #if _POSIX2 && _NO_ANSIMODE
  97. /*
  98.  * POSIX 1003.2 (shell/commands) additions
  99.  */
  100. #define _POSIX2_BC_BASE_MAX     99
  101. #define _POSIX2_BC_DIM_MAX      2048
  102. #define _POSIX2_BC_SCALE_MAX    99
  103. #define _POSIX2_BC_STRING_MAX   1000
  104. #define _POSIX2_COLL_WEIGHTS_MAX        2
  105. #define _POSIX2_EXPR_NEST_MAX   32
  106. #define _POSIX2_LINE_MAX        2048
  107. #define _POSIX2_RE_DUP_MAX      255
  108.  
  109. #endif /* _POSIX2 */
  110.  
  111. #if _POSIX93 && _NO_ANSIMODE
  112. /*
  113.  * POSIX 1003.1b real-time extensions
  114.  */
  115.  
  116. /* 1003.1b specified minimum values for MAX limits
  117.  */
  118. #define _POSIX_AIO_MAX        1       /* num of oustanding async I/O ops  */
  119. #define _POSIX_AIO_LISTIO_MAX    2       /* num of I/O operations per lio    */
  120. #if _ABIAPI || _SGIAPI
  121. #define _ABI_AIO_XFER_MAX    (128 *1024)
  122. #endif /* _ABIAPI */
  123. #define _POSIX_RTSIG_MAX    8       /* max RT sigs for application use  */
  124. #define _POSIX_SIGQUEUE_MAX    32       /* max # of queued signals pending  */
  125. #define _POSIX_MQ_OPEN_MAX    8       /* num of msg queues per process    */
  126. #define _POSIX_MQ_PRIO_MAX    32       /* num of message priorities        */
  127. #define _POSIX_SEM_NSEMS_MAX    256       /* num of semaphores per process    */
  128. #define _POSIX_SEM_VALUE_MAX    32767       /* min value SEM_VALUE_MAX can be   */
  129. #define _POSIX_DELAYTIMER_MAX    32       /* num of timer expiration overruns */
  130. #define _POSIX_TIMER_MAX    32       /* num of timers per process        */
  131.  
  132. /* 1003.1b specified maximum values for MIN limits
  133.  */
  134. #define _POSIX_CLOCKRES_MIN    20000000   /* min CLOCK_REALTIME res in ns     */
  135.  
  136. #endif /* _POSIX93 */
  137.  
  138. #if _XOPEN4UX && _NO_ANSIMODE
  139. #define _XOPEN_IOV_MAX    16
  140. #endif /* _XOPEN4UX */
  141.  
  142. #if _POSIX1C && _NO_ANSIMODE
  143. #define _POSIX_LOGIN_NAME_MAX    9    /* length in bytes incl. null of name */
  144. #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
  145. #define _POSIX_THREAD_KEYS_MAX    128    /* # data keys per process */
  146. #define _POSIX_THREAD_THREADS_MAX 64    /* # threads per process */
  147. #define _POSIX_TTY_NAME_MAX    9
  148. #endif /* _POSIX1C */
  149.  
  150. /*
  151.  * Real limits. Some are only available via sysconf/pathconf
  152.  */
  153. #if _POSIX90 && _NO_ANSIMODE
  154. /*
  155.  * ARG_MAX
  156.  * CHILD_MAX
  157.  * LINK_MAX
  158.  * NAME_MAX
  159.  * OPEN_MAX
  160.  * PATH_MAX
  161.  * STREAM_MAX
  162.  *     - are available only thru sysconf/pathconf
  163.  */
  164. #define NGROUPS_MAX    16        /* max number of groups for a user */
  165. #define TZNAME_MAX      8               /* max # bytes for time zone name */
  166.  
  167. #ifndef    PIPE_BUF    
  168. #define    PIPE_BUF    10240        /* max # bytes atomic in pipe write */
  169. #endif
  170.  
  171. #ifndef MAX_CANON
  172. #define MAX_CANON    256
  173. #endif
  174.  
  175. #ifndef MAX_INPUT
  176. #define    MAX_INPUT    512
  177. #endif
  178.  
  179. #define SSIZE_MAX    LONG_MAX /* yes, its an int but this does the
  180.                   * right thing for 64 bits */
  181.  
  182. #endif /* _POSIX90 */
  183.  
  184. #if _POSIX2 && _NO_ANSIMODE
  185. #define BC_BASE_MAX        99
  186. #define BC_DIM_MAX        2048
  187. #define BC_SCALE_MAX        99
  188. #define BC_STRING_MAX        1000
  189. #define COLL_WEIGHTS_MAX    2
  190. #define EXPR_NEST_MAX        32
  191. #define LINE_MAX        2048
  192. #define RE_DUP_MAX        255
  193. #endif /* _POSIX2 */
  194.  
  195. #if _XOPEN4  && _NO_ANSIMODE
  196. /* 
  197.  * X/Open 4 additions
  198.  *
  199.  * ATEXIT_MAX
  200.  * IOV_MAX
  201.  * PAGESIZE
  202.  * PAGE_SIZE
  203.  *    - are available via sysconf/pathconf
  204.  */
  205. #define    PASS_MAX    32        /* max # of characters in a password */
  206.  
  207. #define CHARCLASS_NAME_MAX    14
  208. #define    NL_ARGMAX    9        /* max value of "digit" in calls to the
  209.                      * NLS printf() and scanf() */
  210. #define    NL_LANGMAX    14        /* max # of bytes in a LANG name */
  211. #define    NL_NMAX        1        /* max # of bytes in N-to-1 mapping characters */
  212. /* also defined in nl_types.h */
  213. #ifndef NL_SETMAX
  214. #define NL_SETMAX    255
  215. #define NL_MSGMAX    32767
  216. #define NL_TEXTMAX    2048
  217. #endif
  218. #ifndef    NZERO        
  219. #define    NZERO        20        /* default process priority */
  220. #endif
  221. #ifndef TMP_MAX
  222. #define TMP_MAX        17576    /* 26 * 26 * 26 */
  223. #endif
  224.  
  225. #define    WORD_BIT    32        /* # of bits in a "word" or "int" */
  226. #if (_MIPS_SZLONG == 32)
  227. #define    LONG_BIT    32        /* # of bits in a "long" */
  228. #endif
  229. #if (_MIPS_SZLONG == 64)
  230. #define    LONG_BIT    64        /* # of bits in a "long" */
  231. #endif
  232.  
  233. #define    DBL_DIG        15        /* digits of precision of a "double" */
  234. #define    DBL_MAX        1.7976931348623157E+308  /* max decimal value of a "double"*/
  235. #define    DBL_MIN        2.2250738585072014E-308  /* min decimal value of a "double"*/
  236. #define    FLT_DIG        6        /* digits of precision of a "float" */
  237. #ifdef __STDC__
  238. #define    FLT_MAX        3.40282347E+38F /* max decimal value of a "float" */
  239. #define    FLT_MIN        1.17549435E-38F /* min decimal value of a "float" */
  240. #else
  241. #define    FLT_MAX        3.40282347E+38  /* max decimal value of a "float" */
  242. #define    FLT_MIN        1.17549435E-38  /* min decimal value of a "float" */
  243. #endif /* __STDC__ */
  244.  
  245. #endif /* _XOPEN4 */
  246.  
  247. #if _SGIAPI
  248. /*
  249.  * Note that for POSIX/XPG3: ARG_MAX, CHILD_MAX, NAME_MAX, OPEN_MAX, PATH_MAX,
  250.  * come LINK_MAX only from sysconf/pathconf, but for default environment we
  251.  * put in backward compatibility defines
  252.  */
  253. #ifndef ARG_MAX
  254. #define ARG_MAX        5120
  255. #endif
  256. #define    CHILD_MAX    25        /* max # of processes per user id */
  257. #define    NAME_MAX    255        /* max # of characters in a file name */
  258. #ifndef OPEN_MAX
  259. #define    OPEN_MAX    20        /* max files a process can have open */
  260. #endif
  261. #ifndef PATH_MAX
  262. #define    PATH_MAX    1024        /* max # of characters in a path name */
  263. #endif
  264. #define    LINK_MAX    30000        /* max # of links to a single file */
  265.  
  266. #define    PID_MAX        30000        /* max value for a process ID */
  267.  
  268. #ifndef    PIPE_MAX
  269. #define    PIPE_MAX    10240        /* max # bytes written to pipe in a wrt */
  270. #endif
  271.  
  272. #define    STD_BLK        1024        /* # bytes in a physical I/O block */
  273. #define    UID_MAX        0x7fffffff     /* max value for a user or group ID */
  274. #define    USI_MAX        UINT_MAX    /* max decimal value of an "unsigned" */
  275.  
  276. #if !defined(SYS_NMLN)
  277. #define SYS_NMLN    257    /* SVR4.0 size of utsname elements */
  278.                 /* also defined in sys/utsname.h */
  279. #endif /* !SYS_NMLN */
  280.  
  281. #ifndef CLK_TCK
  282. #define CLK_TCK    sysconf(3)    /* clock ticks per second */
  283.                 /* 3 is _SC_CLK_TCK */
  284. #endif
  285.  
  286. #define LOGNAME_MAX    8    /* max # of characters in a login name */
  287.  
  288. #endif    /* _SGIAPI */
  289.  
  290. #if _SGIAPI
  291. #if (defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS))
  292. #ifndef HUGE_VAL    
  293. #ifndef __TYPEDEF_H_VAL
  294. #define __TYPEDEF_H_VAL
  295. typedef union _h_val {
  296. #if (_MIPS_SZLONG == 32)
  297.         unsigned long i[2];
  298. #endif
  299. #if (_MIPS_SZLONG == 64)
  300.         __uint32_t i[2];
  301. #endif
  302.         double d;
  303. } _h_val;
  304. #endif /* __TYPEDEF_H_VAL */
  305. extern const _h_val __huge_val;
  306. #define HUGE_VAL __huge_val.d
  307. #endif /* !HUGE_VAL */
  308. #endif /* _LANGUAGE_C || _LANGUAGE_C_PLUS_PLUS */
  309. #endif /* _SGIAPI */
  310.  
  311. #ifdef __cplusplus
  312. }
  313. #endif
  314. #endif /* !__LIMITS_H__ */
  315.